# build myvpn executable when user executes "make"

myvpn: Firewall.o SocketUtil.o Tunnel.o MyVpn.o Common.o Md5.o Protocal.o TunDev.o Config.o
	$(CC) $(LDFLAGS) Firewall.o SocketUtil.o Tunnel.o MyVpn.o Common.o Md5.o Protocal.o TunDev.o Config.o -o myvpn -pthread

MyVpn.o: MyVpn.c
	$(CC) -c $(CFLAGS) MyVpn.c

Common.o: Common.c
	$(CC) -c $(CFLAGS) Common.c

Md5.o: Md5.c
	$(CC) -c $(CFLAGS) Md5.c

Protocal.o: Protocal.c
	$(CC) -c $(CFLAGS) Protocal.c

TunDev.o: TunDev.c
	$(CC) -c $(CFLAGS) TunDev.c

Config.o: Config.c
	$(CC) -c $(CFLAGS) Config.c

SocketUtil.o: SocketUtil.c
	$(CC) -c $(CFLAGS) SocketUtil.c

Tunnel.o: Tunnel.c
	$(CC) -c $(CFLAGS) Tunnel.c

Firewall.o: Firewall.c
	$(CC) -c $(CFLAGS) Firewall.c
# remove object files and executable when user executes "make clean"
clean:
	rm *.o myvpn
